package com.yvan.zipkin;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TracingCollectorAutoConfiguration {

    @Value("${spring.application.name:trace}")
    private String applicationName;

    @Value("${server.port:0}")
    private Integer serverPort;

    @Bean
    public TracingCollectorFactory tracingCollectorFactory() {
        TracingCollectorFactory tracingCollectorFactory = new TracingCollectorFactory();
        tracingCollectorFactory.setApplicationName(applicationName);
        tracingCollectorFactory.setServerPort(serverPort);
        return tracingCollectorFactory;
    }
}
